/**
 * Created by YJH on 2018/5/24.
 */
import React, {Component} from 'react';
import {
    Navigator,
} from 'react-native';
import WelcomePage from './WelcomePage';

function setup() {
    //进行一些初始化的配置
    class RootC extends Component<Props> {

        constructor(props) {
            super(props);
        }

        renderScene(route, navigator) {
            let Component = route.component;
            return <Component {...route.params} navigator={navigator}/>
        }

        render() {
            return (
                <Navigator initialRoute={{component: WelcomePage}}
                          renderScene={(route, navigator) => this.renderScene(route, navigator)}>
                </Navigator>
            )
        }
    }

    return <RootC/>;

}

module.exports = setup;
